local sk__rende = fk.CreateSkill {

  name = "sk__rende",

  tags = {  },

}



sk__rende:addEffect(fk.EventPhaseStart, {
  name = "sk__rende",
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return target ~= player and player:hasSkill(sk__rende.name) and target.phase == Player.Finish and not target.dead and
      not player:isKongcheng()
  end,
  on_cost = function(self, event, target, player, data)
    local cards = player.room:askForCard(player, 1, 999, false, sk__rende.name, true, nil, "#sk__rende-invoke::"..target.id)
    if #cards > 0 then
      event:setCostData(self, cards)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:moveCardTo(event:getCostData(self), Card.PlayerHand, target, fk.ReasonGive, sk__rende.name, nil, false, player)
    if not target.dead then
      target:gainAnExtraPhase(Player.Play,sk__rende.name, true)
    end
  end,
})

return sk__rende